#ifndef HEADER_H
#define HEADER_H

#include <iostream>
#include <vector>

using namespace std;

struct float3 {
	float x;
	float y;
	float z;
};

struct polygon {
	vector<int> node;
};

struct int3 {
	int a;
	int b;
	int c;
};

inline istream& operator >> (istream& is, float3& v) {
	return is >> v.x >> v.y >> v.z;
}

inline ostream& operator << (ostream& os, float3& v) {
	return os << "<" << v.x << "," << v.y << "," << v.z << ">";
}

inline float3 operator + (float3 a, float3 b) {
	float3 c;
	c.x = a.x + b.x;
	c.y = a.y + b.y;
	c.z = a.z + b.z;
	return c;
}

inline float3 operator - (float3 a, float3 b) {
	float3 c;
	c.x = a.x - b.x;
	c.y = a.y - b.y;
	c.z = a.z - b.z;
	return c;
}

inline float3 operator * (float3 a, float b) {
	float3 c;
	c.x = a.x * b;
	c.y = a.y * b;
	c.z = a.z * b;
	return c;
}

inline float3 operator ^ (float3 a, float3 b) {
	float3 c;
	c.x = a.y * b.z - a.z * b.y;
	c.y = a.z * b.x - a.x * b.z;
	c.z = a.x * b.y - a.y * b.x;
	return c;
}

inline ostream& operator << (ostream& os, int3& v) {
	return os << "<" << v.a << "," << v.b << "," << v.c << ">";
}

#endif
